﻿using System;
using System.Data.SqlClient;
using System.Web.UI;
using UDS.Components;

namespace UDS.SubModule.CM
{
    /// <summary>
    /// ClientHistoryContact 的摘要说明。
    /// </summary>
    public partial class ClientHistoryContactPage : Page
    {
        protected override void OnLoad(EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                var cm = new Components.CM();
                int clientid = Int32.Parse(string.IsNullOrEmpty(Request.QueryString["ClientID"]) ? "0" : Request.QueryString["ClientID"]);
                ClientInfo client = cm.GetClientAllInfo(clientid);
                ltl_ClientName.Text = client.ClientName;
                ltl_ClientShortName.Text = client.ClientShortName;
                ltl_UpdateTime.Text = client.UpdateTime.ToShortDateString();
                ltl_Birthday.Text = client.Birthday.ToShortDateString();
                ltl_ContactTimes.Text = client.ContactTimes.ToString();
                ltl_SellPhase.Text = client.SellPhase;
                ltl_BargainPrognosis.Text = client.BargainPrognosis;
                ltl_Fee.Text = client.Fee.ToString();


                //显示销售人员
                var staffInfo = Staff.GetStaffInfo(client.AddManID);
                if(staffInfo != null )
                {
                    ltl_AddMan.Text = staffInfo.RealName;
                }
                ControlClientContactHistory1.ClientID = clientid;
                ControlClientContactHistory1.BindData();
            }

            base.OnLoad(e);
        }
    }
}